from likeshop_project.base.mybase import Tools
from likeshop_project.accountapi.login_api import login_model

class set_default_address_model(Tools):
    path = '/api/user_address/setdefault'
    def set_default_address_action(self,id,hb):
        mydata = {
            'id':id
        }
        res = self.huihua.post(url=self.hosturl+self.path,data=mydata,headers=hb)
        return res.json()


if __name__ == '__main__':

    import requests
    s = requests.session()
    re = login_model(huihua=s)
    mag = re.login_action(account='17909898989',password='123wqewqrf')
    gettoken = mag['data'].get('token')
    hb = {'token':gettoken}
    re = set_default_address_model(huihua=s)
    msg =re.set_default_address_action(id='852',hb=hb)
    print(msg)